package com.beidouapp.mapper;

import com.beidouapp.domain.example.ResourceExample;
import com.beidouapp.domain.pojo.Resource;
import com.beidouapp.domain.pojo.RoleAndResource;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ResourceMapper extends BaseMapper<Resource> {

    public List<Resource> findResourcesByResource(Resource resource);

    public List<Resource> findRoleResourcesByRoleId(@Param("roleId") Long roleId);


    public int removeRoleAndResourceByRoleId(@Param("roleId") Long roleId);

    public int removeRoleAndResourceBatch(Map<String, Object> params);

    public int addRoleAndResourceBatch(List<RoleAndResource> list);


    //----------------------------

    int countByExample(ResourceExample example);

    int deleteByExample(ResourceExample example);

    int insert(Resource record);

    int insertSelective(Resource record);

    List<Resource> selectByExample(ResourceExample example);

    int updateByExampleSelective(@Param("record") Resource record, @Param("example") ResourceExample example);

    int updateByExample(@Param("record") Resource record, @Param("example") ResourceExample example);

    int updateByPrimaryKeySelective(Resource record);

    int updateByPrimaryKey(Resource record);
    
    public List<Resource> findRoleResourcesByContactsLoginName(String LoginName) ;
}